package com.atguigu05.method_more._04recursion.exer2;

/**
 * ClassName: Rabbits
 * Package: com.atguigu05.method_more._04recursion.exer2
 * Description:
 *
 * @Author BuTang
 * @Create 2023/2/28 20:43
 * @Version 1.0
 */
public class Rabbits {
    public static void main(String[] args) {
        Rabbits ra =new Rabbits();
        System.out.println(ra.rabbits(3));
    }

    public int rabbits(int month){
        if(month ==1){
            return 1;
        }else if(month ==2){
            return 1;
        }
        return rabbits(month -1)+ rabbits(month-2);
    }
}
